<template>
  <card v-bind="cardOptions">
    <!-- 工具栏 -->
    <y-table-handler>
      <y-table-filter
        :options="filterOptions"
        @search="searchHandler"
      ></y-table-filter>
      <y-table-operation
        v-bind="operaOptions"
        @add="addHandler"
        @edit="editHandler"
        @delete="deleteHandler"
      ></y-table-operation>
    </y-table-handler>

    <!-- 表格 -->
    <y-table ref="$database" v-bind="tableOptions"></y-table>
  </card>
</template>

<script>
export default {
  data() {
    return {
      cardOptions: {
        title: "数据库管理",
      },
      filterOptions: [
        {
          type: "input",
          field: "keyword",
          placeholder: "请输入关键字",
          bind: [],
        },
      ],
      operaOptions: {
        btns: ["add", "edit", "delete"],
        more: [{ label: "分类添加", trigger: "categoryAdd" }],
      },
      tableOptions: {
        columns: [
          { type: "seq", width: 50 },
          { field: "label", title: "名称" },
          { field: "value", title: "值" },
          { field: "shortName", title: "简称" },
        ],
      },
    };
  },
  methods: {
    searchHandler() {},
    addHandler() {},
    editHandler() {},
    deleteHandler() {},
  },
};
</script>


<style lang="scss" scoped>
</style>